jeklly+Github pages 添加评论

之前的个人博客主要是fork了其他人的源码。基于Jekyll+Github pages。在此基础上改了一些东西,适合自己的才是最好的嘛。最后才准备做评论这方面的东西。

disqus

先去http://www.disqus.com/注册了username,修改了相关了html文件。讲道理是可以用的,评论框在文章页面一直加载不出来,过一会又会出现reload。我是在科学上网啊,讲道理不应该。作为一个二把手又看了一遍源码,什么也没看出来。只好放弃disqus。

多说

这个就算不科学上网也该可以了吧。先去注册搞到了username,http://duoshuo.com再根据源码,添加多说评论。


comments_provider: duoshuo
duoshuo_username: x-nicolo

再根据多说给的代码粘贴到模板代码里:

<!-- 多说评论框 start -->
    <div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"x-nicolo"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
<!-- 多说公共JS代码 end -->

这样就可以了。

谢谢你请我吃糖果!